import React from 'react'
import { Row, Col } from 'antd'
import './index.less'
import Util from '../../utils/utils'

export default class Header extends React.Component{
  componentWillMount() {
    this.setState({
      userName: '河畔一角'
    })
    setInterval(() => {
      let sysTime = Util.formateDate(new Date().getTime())
      this.setState({
        sysTime
      })

    }, 1000)
  }

  render() {
    return (
      <div className="header">
        <Row className="header-top">
          <Col>
            <span>欢迎， {this.state.userName}</span>
            <a href="http://www.hihj.cn" title="">退出</a>
          </Col>
        </Row>

        <Row className="breadcrumb">
          <Col span={4} className="breadcrumb-title">
            首页
          </Col>
          <Col span={20} className="weather">
            <span>{this.state.sysTime}</span>
            <span className="info">晴转多云</span>
          </Col>
        </Row>
      </div>
    )
  }
}